package com.tuanzi.loan.api.controller;

import com.tuanzi.loan.business.service.statistics.SmsStatisticsService;
import com.tuanzi.loan.vo.request.statistics.RecordRequest;
import com.tuanzi.loan.vo.response.statistics.SmsStatisticsResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Date;

@Slf4j
@RestController
@RequestMapping("/api/arr")
public class ActivityRegisterRecordController {

    @Autowired
    private SmsStatisticsService smsStatisticsService;

    @PostMapping
    public @ResponseBody SmsStatisticsResponse.ActivityRegisterRecord get(@RequestBody RecordRequest request) {
        return smsStatisticsService.getRecord(request.getChannel(), request.getActivity(), new Date(request.getDate()));
    }
}
